<!DOCTYPE html>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <!-- <link rel="stylesheet" href="./css/font.css"> -->
  <link rel="stylesheet" href="./css/xadmin.css">
  <link rel="stylesheet" href="/lib/layui/css/layui.css.css">
  <script type="text/javascript" src="./js/xadmin.js"></script>
  <script src="/js/jquery.min.js"></script>
  <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
  <style>
    .layui-fluid {
      margin-top: 20px;
    }

    .form-header .layui-form-label {
      width: auto;
      padding: 9px;
      line-height: 14px;
    }

    th {
      font-weight: 700 !important;
    }

    .layui-form-onswitch {
      background: rgb(27, 132, 252) !important;
      border-color: rgb(0, 110, 255);
    }

    img {
      border: none;
      width: 100%;
      display: block;
      margin: 0 auto;
    }

    .layui-table img {
      max-width: 140px;
    }

    .layui-btn-group .layui-btn {
      margin-left: 10px !important;
      margin-right: 2px !important;
      border-radius: 20px !important
    }

    .layui-btn-group .layui-btn:first-child {
      background-color: #62BFFA !important;
    }

    .layui-btn-group .layui-btn:last-child {
      background-color: #FC6455 !important;
    }
  </style>

</head>

<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">首页</a>
      <a href="">演示</a>
      <a>
        <cite>导航元素</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
      onclick="location.reload()" title="刷新">
      <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
  </div>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <!-- 这是文章列表、修改、删除、增加 -->

      <form class="layui-form form-header">

        <div class="layui-form-item">

          <label class="layui-form-label">标题</label>
          <div class="layui-input-inline">
            <input type="text" name="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off"
              class="layui-input">
          </div>

          <label class="layui-form-label">分类</label>
          <div class="layui-input-inline">
            <select name="cate"></select>
          </div>

          <label class="layui-form-label">开始时间</label>
          <div class="layui-input-inline">
            <input type="text" class="layui-input" autocomplete="off" id="start_time" name="create_date">
          </div>
          <label class="layui-form-label">结束时间</label>
          <div class="layui-input-inline">
            <input type="text" class="layui-input" autocomplete="off" id="end_time" name="create_date">
          </div>

          <div class="layui-input-inline">
            <button type="button" id="search" class="layui-btn layui-btn-normal">搜索</button>
          </div>
        </div>
      </form>
      <button type="button" id="addCate" class="layui-btn layui-btn-primary layui-btn-sm">
        <i class="layui-icon">&#xe654;</i>
      </button>
      <a href="/excel/文章信息.xlsx" id="download" class="layui-btn layui-btn-sm">
        <i class="layui-icon">&#xe601;</i>
      </a>


      <!-- 显示信息 -->
      <table class="layui-table">
        <colgroup>
          <col width="100">
          <col width="100">
          <col width="100">
          <col width="180">
          <col width="150">
          <col width="100">
          <col width="100">
          <col width="100">
          <col width="200">
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>标题</th>
            <th>分类名</th>
            <th>图片</th>
            <th>创建时间</th>
            <th>是否推荐</th>
            <th>是否置顶</th>
            <th>文章状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>

        </tbody>
      </table>

      <!-- 分页区域 -->
      <div id="pageBox" style="float:right;"></div>

    </div>
  </div>

  <!-- 分类模板引擎 -->
  <script type="text/html" id='tpl_cate'>
    <option value="">请选择</option>
    {{each data}}
    <option value="{{$value.id}}">{{$value.catename}}</option>
    {{/each}}
  </script>

  <!-- 文章列表模板引擎 -->
  <script type='text/html' id="tpl_list">
    {{each data}}
    <tr>
      <td>{{$value.id}}</td>
      <td>{{$value.title}}</td>
      <td>{{$value.catename}}</td>
      <td>
        <img src="{{'http://192.168.21.69:8060/' + $value.pic}}" alt="">
      </td>
      <td>{{$value.create_date|getdate}}</td>
      <td>
        <form class="layui-form">
            <input type="checkbox" lay-skin='switch' class="ishot" {{$value.ishot== '1' ? 'checked' : ''}} disabled >
        </form>
      </td>
      <td>
        <form class="layui-form">
          <input type="checkbox" lay-skin='switch' class="istop" {{$value.istop== '1' ? 'checked' : ''}}  disabled>
        </form>
      </td>
      <td>
        <button type="button" class="layui-btn layui-btn-normal">{{$value.status|formate}}</button>
      </td>
      <td>
        <div class="layui-btn-group">
          <button type="button"  id="updatebtn" data-id="{{$value.id}}" class="layui-btn layui-btn-primary layui-btn-sm">
            <i class="layui-icon">&#xe642;</i>
          </button>

          <button type="button" id="btn_del" data-id="{{$value.id}}" class="layui-btn layui-btn-primary layui-btn-sm">
            <i class="layui-icon">&#xe640;</i>
          </button>
        </div>
      </td>
    </tr>
    {{/each}}
  </script>


  <!-- script -->
  <script src="/lib/layui/layui.all.js"></script>
  <script>

    layui.use('laydate', function () {
      var laydate = layui.laydate;
      //日期范围
      laydate.render({
        elem: '#start_time',
      });
      //日期范围
      laydate.render({
        elem: '#end_time',
      });
    });
  </script>

  <script src="/lib/layui/template-web.js"></script>
  <script src="/js/baseAPI.js"></script>
  <script src="/js/article.js"></script>

</body>

</html>